package com.qd.common.panda.domain.entity.card.third.sync;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 劵列表
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ThirdPartyListDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "第三方券码不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 100, message = "第三方券码长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String thirdCouponCode;
    /**
     * 兑换时间
     */
    private LocalDateTime redemptionTime;
    /**
     * 使用时间
     */
    private LocalDateTime useTime;
    /**
     * 卡劵状态:-1未兑换0未兑换1已兑换2已使用3已过期
     */
    @NotNull(message = "卡卷状态:0未兑换1已兑换2已使用3已过期不能为空", groups = DefaultGroup.class)
    private Integer state;
    /**
     * 卡劵状态显示
     */
    private String stateDisplay;
    /**
     * 事件
     */
    @NotBlank(message = "事件不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "事件长度不能超过{max}位", groups = DefaultGroup.class)
    private String event;
    /**
     * 卡卷ID
     */
    @Size(max = 50, message = "卡卷ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String cardId;
    /**
     * 第三方券商
     */
    @NotBlank(message = "第三方券商不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "第三方券商长度不能超过{max}位", groups = DefaultGroup.class)
    private String thirdParty;
    /**
     * 第三方券商显示
     */
    private String thirdPartyDisplay;
    @Override
    public void freeData() {
        this.thirdCouponCode = null;
        this.redemptionTime = null;
        this.useTime = null;
        this.state = null;
        this.stateDisplay = null;
        this.event = null;
        this.cardId = null;
        this.thirdParty = null;
        this.thirdPartyDisplay = null;
        super.freeData();
    }
}
